﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using HousingInfo.Library;

namespace NEWS.Admin
{
    public partial class EditForums : System.Web.UI.Page
    {
        public static string modedelete,modeid,modecate,modedeleforum;
        protected void Page_Load(object sender, EventArgs e)
        {
            modedelete = Request.QueryString["deletecomment"];
            modeid = Request.QueryString["id"];
            modecate = Request.QueryString["categoryid"];
            modedeleforum = Request.QueryString["deleteforum"];
            if (modedelete != null)
            {
                ForumCommentBO.DeleteForumCommentBO(Convert.ToInt32(modedelete));
                Response.Redirect("EditForums.aspx?categoryid=" + modecate + "&id=" + modeid);
            }
            else if (modedeleforum != null)
            {
                //ForumCommentBO.DeleteForumCommentBO(Convert.ToInt32(modedelete));
                //Response.Redirect("EditForums.aspx?categoryid=" + modecate + "&id=" + modeid);
            }
        }

        protected void btnxoa_Click(object sender, ImageClickEventArgs e)
        {
            //<a href="EditForum.aspx?deleteforum=<%=objectForums.ForumNewID %>" onclick="confirmAction()">
            //                            <img border="0" align="left" src="img/edit.gif" />
            //                            </a>
            try
            {
                //thuc hien xoa cac tin comment cua tin nay

                //thuc hien xoa tin nay
                ForumNewsBO.DeleteForumNewsBO(Convert.ToInt32(modeid));
                Response.Redirect("Forums.aspx");
            }
            catch { }
        }
    }
}
